#!/bin/bash

TMPFILE=`tempfile`

for fn in ./*.glsl
do
        name=`basename $fn .cg`
	sed "s/sampler2D .*;/sampler2D s_texture;/g" $fn > $TMPFILE
	mv $TMPFILE $fn

	sed "s/gl_TexCoord\[0\]/v_texCoord/g" $fn > $TMPFILE
	mv $TMPFILE $fn
done
